<?php include "../../coresection/connection.php";?>
<?php include "../../coresection/checkSession.php";?>
<?php include "../../coresection/order-list.php";?>
<?php include "../../coresection/admin-product.php";?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <?php include '../../modules/head.php'; ?>
</head>

<body>
<?php include '../../modules/topbar.php'; ?>

<div class="setup_area">
    <?include '../../modules/sidebar-admin.php'?>

    <div class="header">
        <h1>餐单列表</h1>
        <?php include '../../modules/header.php'; ?>
    </div>


    <div class="content_area">




<div class="main product-manage" >

    <div class="content">
        1.厨房修改或新增的的菜式默认状态为"待审核";<br/>
        2.菜式必须经过财务或者管理员审核，才能发布在前台。<br/>
    </div>

    <p class="function">
        <a href="/controlbase/dishes/detail-list.php" class="layui-btn">菜式库管理</a>
        <a href="admin_productadd.php" class="layui-btn">新增餐单菜式</a>
        <a href="admin_productadd_mulity.php" class="layui-btn">批量增加餐单菜式</a>
        <a href="admin_productadd_mulity2.php" class="layui-btn">批量增加餐单菜式(测试)</a>

<!--        <a href="admin_productset_week.php?week=this" target="_blank">本周菜式</a>-->
<!--        <a href="admin_productset_week.php?week=next" target="_blank">下周菜式</a>-->
    </p>


    <table cellpadding="0" cellspacing="0" border="0" class="layui-table">
        <colgroup>
            <col >
            <col >
            <col >
            <col >
            <col >
        </colgroup>


        <thead>
        <tr>
            <td>菜式名</td>
            <td>单价</td>
            <td>月份</td>
            <td>日期</td>
            <td>时段</td>
            <td>状态</td>
            <td>操作</td>
        </tr>
        </thead>
        <tbody>
        <?php for($i=0;$i<$sum;$i++){?>
        <tr <? if(
            (number_format(date(m))>$product_month[$i])||
            (
                (number_format(date(m))==$product_month[$i])
                &&
                (number_format(date(d))>$product_week[$i])
            )
        )
        {echo "style='background-color:#ececec'";}?>
            >

            <td><?echo $product_names[$i]?></td>
            <td><?echo $product_price[$i]?></td>
            <td><?echo $product_month[$i]?>月
                <? if(
                    (number_format(date(m))>$product_month[$i])||
                    (
                        (number_format(date(m))==$product_month[$i])
                        &&
                        (number_format(date(d))>$product_week[$i])
                    )
                )
                {echo "/失效";}
 ?>
            </td>
            <td ><?echo $product_week[$i]?></td>

            <td style="display:none">
                <?
                switch($product_week[$i]){
                    case 0:
                        echo "星期日";
                        break;
                    case 1:
                        echo "星期一";
                        break;
                    case 2:
                        echo "星期二";
                        break;
                    case 3:
                        echo "星期三";
                        break;
                    case 4:
                        echo "星期四";
                        break;
                    case 5:
                        echo "星期五";
                        break;
                    case 6:
                        echo "星期六";
                        break;
                }
                ?>
            </td>
            <td>
                <?
                switch($product_at[$i]){
                    case 1:
                        echo "早餐";
                        break;
                    case 2:
                        echo "午餐";
                        break;
                    case 3:
                        echo "晚餐";
                        break;
                }
                ?>
            </td>


            <td <? if($product_status[$i]=="待审核"){echo "style='color:red' ";}?>><?echo $product_status[$i]?></td>


            <td><a href="admin_productedit.php?edit=<?echo $product_ids[$i]?> ">修改</a> | <a href="../../front/m2/coresection/delect-product.php?delected=<?echo $product_ids[$i]?>">删除</a></td>
        </tr>
        <? } ?>
        </tbody>
    </table>
</div>

        <?php include '../../modules/footer.php'; ?>
</body>
</html>